 mui.init();
mui.plusReady(function() {
	
	
	
	//双击退出
	var first = null;
	mui.back = function() {
		if(!first) {
			first = new Date().getTime();
			plus.ui.toast('再按一次退出系统!');
			setTimeout(function() {
				first = null;
			}, 2000);
		} else {
			if(new Date().getTime() - first < 2000) {
				plus.runtime.quit();
			}
		}
	};

var cookie=  $.AMUI.utils.cookie;
	var time=new Date();
	time=new Date(time.valueOf() + 24*60*60*1000);
	var sessionId=(cookie.get("sessionId")==null)?"":cookie.get("sessionId");
	cookie.set("sessionId",sessionId,time,"/");
	var factoryid=(cookie.get("factoryid")==null)?"":cookie.get("factoryid");
	cookie.set("factoryid",factoryid,time,"/");
	
});
 
